home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 746 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.4 KB

  1. From: jcoffin@rmii.com (Jerry Coffin)
  2. Message-ID: <MPLANET.314b1623jcoffin989869@news.rmii.com>
  3. X-Original-Date: Sat, 16 Mar 1996 12:27:31 -0700
  4. Path: in1.uu.net!bounce-back
  5. Date: 17 Mar 96 03:53:58 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Conforming compilers should compile STL?
  9. Organization: TAEUS
  10. References: <199603151701.LAA06783@frodo.pswtech.com><Pine.A32.3.91.960315223344.90639A-100000@pluto.mscc.huji.ac.il>
  11. X-Newsreader: MicroPlanet News32 v1.00 Beta Build 302
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMUuM++EDnX0m9pzZAQH2GQGAoIqmrdFkxUAM5ocGOlyFjfGojogHlED+
  14.     4iSOoKA0s5nGpVEHN5UVMBrXE7Xb+LTo
  15.     =XA0U
  16.  
  17. In article <Pine.A32.3.91.960315223344.90639A-100000@pluto.mscc.huji.ac.il>, 
  18. <mslamm@pluto.MSCC.huji.AC.IL> says...
  19.  
  20. [ ... ] 
  21.  
  22. > This I can understand. But isn't the standard going to include an 
  23. > implementation of the STL? 
  24. > It seems to me that only specifing the interface can lead to unexpected 
  25. > problems. 
  26.  
  27. If the specification of the interface is too loose, it will doubtless lead to 
  28. difficulties.  IMO, if anything the specification of STL goes a bit too far, 
  29. getting into some issues I'd consider more implementation considerations than 
  30. interface.  (guarantees of computational complexity being one of those areas.)
  31.  
  32. > As far as I know other parts of the standard library are descirbed with 
  33. > the implementation. Or is the implementation I see in magazines just the 
  34. > authors fancy?
  35.  
  36. No.  The standard describes what each function has to do, but not how it has 
  37. to do that.  For instance, a string function might be required to return the 
  38. position of a character in a string.  The standard doesn't say it has to use a
  39. linear search to find it.  If you wanted to, you could pre-index your strings 
  40. and retrieve character positions from the index.  Ultimately, as long as you 
  41. accept the correct argument(s) and return the correct information, you're 
  42. nearly free to implement things the way you choose.
  43.  
  44. > One more question. If the STL is part of the proposed standard, won't 
  45. > compiler vendors HAVE to supply some implemenation of it?
  46.  
  47. If they want to conform to the C++ standard they will, as STL won't really be 
  48. anything separate as such - it'll simply be another part of the standard like 
  49. the string class, iostreams, etc.
  50.  
  51. OTOH, it's worth noting that conformance to standards is far from being an 
  52. absolute.  There are lots of things that call themselves C compilers that 
  53. aren't very close to the C standard, many FORTRAN compilers that "conform to 
  54. FORTRAN 66 with some FORTRAN 77 extensions.", COBOL compilers that don't 
  55. handle all of COBOL 74, etc.  
  56.  
  57. On one hand, there's little doubt that conforming to the C++ standard will be 
  58. far more difficult than to the current FORTRAN and COBOL standards, but OTOH, 
  59. it's quite clear that in the C/C++ market, there's a much greater push for a 
  60. standard that's meaningful and compilers that conform to it. (In contrast to, 
  61. for instance, the Pascal world, where saying a compiler conforms to the ANSI 
  62. or ISO standard borders on being an insult...)
  63.     Later,
  64.     Jerry.
  65. ---
  66. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  67. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  68. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  69. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  70. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  71.